#ifndef MYMAINWINDOW_H
#define MYMAINWINDOW_H

#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QAction>
#include <QProgressBar>
#include <QStatusBar>
#include <QToolBar>
#include <QPushButton>

#include "mywidget.h"
#include "backend.h"
#include "opencldialog.h"
#include "motionblurdialog.h"
#include "blurdialog.h"
#include "transforminfo.h"
#include "global_flag.h"

/// Main window for the application
class MyMainWindow : public QMainWindow
{
    Q_OBJECT

    QMenu* _fileMenu;
    QMenu* _filterMenu;
    QMenu* _aboutMenu;
    QMenu* _edgesSubMenu;

    QAction* _fileOpenAction;
    QAction* _fileSaveAction;
    QAction* _openCLAction;
    QAction* _quitAction;

    QAction* _aboutQtAction;

    QAction* _blurAction;
    QAction* _motionBlurAction;
    QAction* _findHorizontalEdgesAction;
    QAction* _findVerticalEdgesAction;
    QAction* _find45DegreeEdgesAction;
    QAction* _findAllEdgesAction;
    QAction* _sharpenAction;
    QAction* _excessiveEdgesAction;
    QAction* _embossAction;

    QAction* _zoomInAction;
    QAction* _zoomOutAction;
    QAction* _zoomResetAction;

    QAction* _swapAction;

    MyWidget* _myWidget;
    OpenCLDialog* _openCLDialog;

    Backend* _backend;

    QProgressBar* _progressBar;

    QPushButton* _cancelButton;

    QToolBar* _toolBar;

    QLabel* _label;

    void setup_menu();
    void setup_toolbar();
    void enable_save();
    void disable_ui();
    void enable_ui();
    void enable_cancel();
    void disable_cancel();
    void disable_save();
private slots:
    void file_open_triggered();
    void file_save_triggered();
    void opencl_triggered();

    void about_qt_triggered();

    void blur_triggered();
    void motion_blur_triggered();
    void find_horizontal_edges_triggered();
    void find_vertical_edges_triggered();
    void find_45_degree_edges_triggered();
    void find_all_edges_triggered();
    void sharpen_triggered();
    void excessive_edges_triggered();
    void emboss_triggered();

    void zoom_in_triggered();
    void zoom_out_triggered();
    void zoom_reset_triggered();
    void swap_triggered();

    void finished(double time);

    void update_progress_bar(int);

    void cancel_clicked();
public:
    explicit MyMainWindow(QWidget *parent = 0);
    bool eventFilter(QObject* o, QEvent* e);

signals:

public slots:

};

#endif // MYMAINWINDOW_H
